#导包
import cv2

# #读图
# img = cv2.imread('./code.png',cv2.IMREAD_GRAYSCALE)

# print(img)

# #写图
# cv2.imwrite('./code1.png',img)

# from PIL import Image,ImageDraw
#
# # 读图操作
# im = Image.open("./static/12.jpg")
# print(im.format,im.size,im.mode)
#
# # 生成画笔
# draw = ImageDraw.Draw(im)
#
# # 绘制
# draw.text((175,180),'1907',fill=(76,234,124,180))
# im.show()


# 图像压缩
# 读图
img = cv2.imread('./static/16.png')

# 压缩操作
cv2.imwrite('./static/16.png',img,[cv2.IMWRITE_PNG_COMPRESSION,9])

# jpg
# cv2.imwrite('./static/12.jpg',img,[cv2.IMWRITE_JPEG_QUALITY,50])
